package com.ruoyi.yipaiju.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yipaiju.mapper.HouseEstateMapper;
import com.ruoyi.yipaiju.domain.HouseEstate;
import com.ruoyi.yipaiju.service.IHouseEstateService;

/**
 * 小区Service业务层处理
 * 
 * @author liuwp
 * @date 2025-06-28
 */
@Service
public class HouseEstateServiceImpl implements IHouseEstateService 
{
    @Autowired
    private HouseEstateMapper houseEstateMapper;

    /**
     * 查询小区
     * 
     * @param id 小区主键
     * @return 小区
     */
    @Override
    public HouseEstate selectHouseEstateById(Long id)
    {
        return houseEstateMapper.selectHouseEstateById(id);
    }

    /**
     * 查询小区列表
     * 
     * @param houseEstate 小区
     * @return 小区
     */
    @Override
    public List<HouseEstate> selectHouseEstateList(HouseEstate houseEstate)
    {
        return houseEstateMapper.selectHouseEstateList(houseEstate);
    }

    /**
     * 根据业务主键查询一条记录：小区
     *
     * @param houseEstate 小区
     * @return 小区
     */
    @Override
    public HouseEstate selectOneHouseEstate(HouseEstate houseEstate)
    {
        return houseEstateMapper.selectOneHouseEstate(houseEstate);
    }

    /**
     * 新增小区
     * 
     * @param houseEstate 小区
     * @return 结果
     */
    @Override
    public int insertHouseEstate(HouseEstate houseEstate)
    {
        houseEstate.setCreateTime(new Date());
        return houseEstateMapper.insertHouseEstate(houseEstate);
    }

    /**
     * 修改小区
     * 
     * @param houseEstate 小区
     * @return 结果
     */
    @Override
    public int updateHouseEstate(HouseEstate houseEstate)
    {
        houseEstate.setUpdateTime(new Date());
        return houseEstateMapper.updateHouseEstate(houseEstate);
    }

    @Override
    public int updateHouseEstateCondition(HouseEstate houseEstate, HouseEstate houseEstateCondition)
    {
        houseEstate.setUpdateTime(new Date());
        return houseEstateMapper.updateHouseEstateCondition(houseEstate, houseEstateCondition);
    }

    /**
     * 批量删除小区
     * 
     * @param ids 需要删除的小区主键
     * @return 结果
     */
    @Override
    public int deleteHouseEstateByIds(Long[] ids)
    {
        return houseEstateMapper.deleteHouseEstateByIds(ids);
    }

    /**
     * 删除小区信息
     * 
     * @param id 小区主键
     * @return 结果
     */
    @Override
    public int deleteHouseEstateById(Long id)
    {
        return houseEstateMapper.deleteHouseEstateById(id);
    }

    /**
     * 条件删除小区
     *
     * @param houseEstate 小区
     * @return 结果
     */
    @Override
    public int deleteHouseEstateByCondition(HouseEstate houseEstate)
    {
        return houseEstateMapper.deleteHouseEstateByCondition(houseEstate);
    }

}
